package com.bdqn.ch03.dao;

import com.bdqn.ch03.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;


//@Mapper
public interface UserMapper {
    @Select("SELECT usr_id, usr_name, usr_password, usr_role_id, usr_flag from sys_user where usr_id = #{id}")
    @Results({
            @Result(column = "usr_id", property = "usrId"),
            @Result(column = "usr_name", property = "usrName"),
            @Result(column = "usr_password", property = "usrPassword"),
            @Result(column = "usr_role_id", property = "usrRoleId"),
            @Result(column = "usr_flag", property = "usrFlag")
    })
    public User get(Long id);

    @Delete("DELETE FROM sys_user WHERE usr_id =#{id}")
    public void delete(Long id) throws Exception;
}
